/**
 * Copyright(C) 2012 Luvina Software Company
 *
 * TblUserLogicImpl.java, 28/12/2012, NgocAnh
 */
package net.luvina.manageuser.logic.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import net.luvina.manageuser.dao.TblUserDao;
import net.luvina.manageuser.dto.UserDetailDto;
import net.luvina.manageuser.logic.TblUserLogic;

/**
 * get list user
 *
 * @author la-pm Ngoc Anh
 *
 */
@Service("tblUserLogic")
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false, rollbackFor = { Throwable.class })
public class TblUserLogicImpl implements TblUserLogic {
    @Autowired
    private TblUserDao tblUserDao;

    /*
     * (non-Javadoc)
     *
     * @see net.luvina.manageuser.logic.TblUserLogic#getListUser(int, int, int,
     * java.lang.String, java.lang.String, java.lang.String, java.lang.String,
     * java.lang.String)
     */
    public List<UserDetailDto> getListUser(final int offset, final int limit,
            final int groupId, final String fullName, final String sortType,
            final String sortByFullName, final String sortByCodeLevel,
            final String sortByEndDate) {
        return tblUserDao.getListUser(offset, limit, groupId, fullName,
                sortType, sortByFullName, sortByCodeLevel, sortByEndDate);
    }

    /*
     * (non-Javadoc)
     * @see net.luvina.manageuser.logic.TblUserLogic#getTotalRecords(int, java.lang.String)
     */
    public int getTotalRecords(int groupId, String fullName) {
        return tblUserDao.getTotalRecords(groupId, fullName);
    }

}
